<?php
include("page.class.php");
$img=getImageInfo($_GET['id']);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" /><!--如果是IE8时强制以IE7显示-->
<meta name="keywords" content=""><!--SEO关键字-->
<meta name="description" content=""><!--SEO描述-->
<link rel ="" href=""><!--选项卡图标-->
<title></title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/style.css">

<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript" src="js/page_map.js"></script>

</head>


<body>
	
	<?php include("include/header.php");?>
	<div class="page">
		<div class="photo_info">
			<div class="photo_owner">
				<div class="owner_img"><img src="<?php echo showPageAvatar($_GET['id']);?>" style="width:50px;height:50px;" /><!-- 这里插入拍照者头像 --></div>
				<div class="owner_name"><a href="user_album.php?pic=<?php echo $_GET['id'];?>" class="f16 545454"><?php echo showUserName($img[0]->post_user);?></a></div><!-- 姓名 -->
				<div class="photostats">
					<span class="7e7e7e"></span><a href=""><?php echo $img[0]->name;?></a>
					<span class="7e7e7e"><?php echo $img[0]->create_time;echo $img[0]->address;?><span>
				</div><!-- 照片名称及上传时间 -->
			</div>
			<div class="img">
				<?php
				for($i=0;$i < count($img);$i++){
					if($img[$i]->img_id){
						echo '<div>更新时间：'.$img[$i]->create_time.'</div>';
						echo '<div class="img_r"><img id="img" onload="original();" src="image.php?up_id='.$img[$i]->id.'&type=big"  alt="照片名" /><!-- 照片 --></div>';
					}
					else {
						echo '<div>更新时间：'.$img[$i]->create_time.'</div>';
						echo '<div class="img_r"><img id="img" onload="original();" src="image.php?id='.$img[$i]->id.'&type=big"  alt="照片名" /><!-- 照片 --></div>';
					}
					?>
				
				<?php
			}
			?>
			<!--
				<h3 class="mt20" id="morepic">他的更多照片</h3><!--更多图片
				<div class="more_pics pr mt10">
					<a href="" class="to_left pa"></a>
					<div class="little_picBox pr">
						
					</div>
					<a href="" class="to_right pa"></a>
				</div><!--end_更多图片-->

			<!--评论部分-->
			</div>
			<div class="comment">
				<div class="co in">
					<form method="POST" name="comm_form">
						<div class="owner_img"><img src="<?php if($_SESSION['login_mail']==""){echo "img/simple.png";}else{echo showUserAvatar($_SESSION['login_mail']);}?>"  style="width:50px;height:50px" alt="" /></div>
						<div class="co_input">
							<?php if($_SESSION['login_mail']!=""){?>
								<textarea name="comment" id="comment" class="co_in"></textarea>
							<?php }else{?>
							游客回复请先<a href="login.php?pageid=<?php echo $_GET['id'];?>">登录</a>
							<?php }?>
						</div>
						<div class="co_button"><a href="#" class="comment_button dib" onclick="return checkComm();"><span>评&nbsp&nbsp论</span></a></div>
						<div id="check_comm" style="width:200px;height:20px"></div>
					</form>
				</div>
				<!--新评论时的用户数据-->
				<div id="co_hidden" style="display:none">
					<div id="user_avatar"><img style='width:40px; height:40px;' src="<?php echo showUserAvatar($_SESSION['login_mail']);?>" alt="" /></div>
					<div id="user_name"><a href="" class="f16  545454"><?php echo showUserName($_SESSION['login_mail']);?></a></div>
				</div>
				<?php
				$sql="select * from comment where img_id='$_GET[id]' order by create_time desc limit 20";
				$re=mysql_query($sql)or die(mysql_error());
				$i=1;
				while($row=mysql_fetch_array($re)){
					if($i==5){echo "<div id='hidden_comm' style='display:none'>";}
					echo "<div class='co'>";
					echo "<div class='owner_img'><img style='width:40px; height:40px;' src='".showUserAvatar($row['comm_user'])."' /></div>";
					echo "<div class='owner_name'><a href='' class='f16  545454 '>".showUserName($row['comm_user'])."</a><span class='7e7e7e f12'> &nbsp 于&nbsp".$row['create_time']."<span></div>";
					echo "<div class=co_main><span class='7e7e7e f14'>".$row['comment']."</span></div>";
					echo "</div>";
					$i++;
					}
					echo "</div>";
				?>
				<a href="#" id="showmore" class="read_more dib"  onclick="return showmore();">查看更多>></a>
			</div>
			<div class="pa_r">			
				<div class="pa_r_t" id="container">	
				</div>
			</div>	
		</div>
	</div>
	
	<!--用于JS获得经纬度-->
	<div id="lng" style="display:none"><?php echo getLng();?></div>
	<div id="lat" style="display:none"><?php echo getLat();?></div>

</body>
</html>
